package com.aote.entity.entityfinder;

import javax.servlet.http.HttpServletRequest;

import org.w3c.dom.Element;

import com.browsesoft.Entity;
import com.browsesoft.htmlcomponent.HTMLBasicComponent;

public class ComponentEntityGather implements EntityFinder {

	public Entity getEntity(HttpServletRequest request, Element element,
			HTMLBasicComponent component) {
		/**
		 * 根据compid得到component,并得到对应的model
		 */
		String compid = request.getParameter("compid");
		HTMLBasicComponent comp = HTMLBasicComponent.getComponentByID(request,
				compid);
		Entity model = (Entity) comp.getModel();
		return model;
	}
}
